//
//  main.c
//  2
//
//  Created by edz on 2020/6/22.
//  Copyright © 2020 edz. All rights reserved.
//

#include <stdio.h>

#if 0
//练习2-1
int main(int argc, const char * argv[]) {
    int a,b,c;
    puts("请输入两个整数。");
    printf("整数a："); scanf("%d", &a);
    printf("整数b："); scanf("%d", &b);
    c = a * 100 / b;
    printf("第一个整数是第二个整数的%.2d%%\n",c);
    return 0;
}
#endif

#if 0
//练习2-2
int main(void)
{
    int a, b;

    puts("请输入两个整数。");
    printf("整数a："); scanf("%d", &a);
    printf("整数b："); scanf("%d", &b);

    printf("两个数的和为%d\n",a+b);
    printf("两个数的积为%d\n",a*b);

    return 0;
}
#endif

#if 0
// 练习2-3
int main (){
    double a;
    printf("请输入一个实数:");
    scanf("%lf",&a);
    printf("你输入的是%lf\n",a);
    return 0;
}
#endif


#if 0
//练习2-5
int main(int argc, const char * argv[]) {
    int a,b;
    float c = 0;
    puts("请输入两个整数。");
    printf("整数a："); scanf("%d", &a);
    printf("整数b："); scanf("%d", &b);
    c = a * 100 / b;
    printf("第一个整数是第二个整数的%.2f%%\n",c);
    return 0;
}
#endif

#if 0
//练习2-6
int main(){
    int height;
    double weight;
    printf("请输入你的身高：");
    scanf("%d",&height);
    weight = (height - 100) * 0.9;
    printf("你的标准体重为：%.1lf\n",weight);
    return 0;
}
#endif
